home *** CD-ROM | disk | FTP | other *** search
/ Acorn RISC PD-CD 1 / Acorn RISC PD-CD 1.iso / schools / sciapps / _scimodel / _help < prev    next >
Text File  |  1992-05-19  |  6KB  |  140 lines

  1.  
  2.     /---------------------------------------------------\
  3.     | !SciModel - by Dr. Roderick Ferguson, March 1992. |
  4.     \---------------------------------------------------/
  5.  
  6.     !SciModel is a RISC OS 'desktop friendly' general
  7. purpose nonlinear least squares curve fitting (NLLSQ)
  8. application. It uses the same format of data file as
  9. my !SciGraph application.
  10.  
  11.     The nonlinear least squares curve routines are based
  12. on the LevenBerg-Marquhardt Algorithm which is explained
  13. in the excellent book "Numerical Recipes: The Art of
  14. Scientific programming". The routines used in this program
  15. were taken from the FORTRAN source code given in this book.
  16.  
  17.     To get more help when using this program, use the
  18. interactive help application, "!Help".
  19.  
  20.     The built in models (given in the 'models' file and 
  21. available from the main menu) include ones which most Polymer
  22. Chemists would use for routine work. [Yes, I am a Polymer Chemist!]
  23.  
  24.  
  25.  
  26.     For a full description of the NLLSQ routines, see chapter 14
  27. in the "Numerical Recipes" book by W.H. Press et al. (published
  28. by Cambridge University Press, Cambridge). However, for those
  29. people who haven't yet read this worthy book, here are a few
  30. points to note:-
  31.  
  32. The quantity being minimised is the ChiSquared function which is
  33. defined as the sum over all of the data points of the quantity
  34. (Ri)^2 {for i=1 to N}
  35.  
  36.             (Yi - Fi)
  37. where Ri = [---------], 
  38.              (Sig i)
  39.  
  40. Yi = the i'th experimental Y value, Sig i = ErrY, the Absolute
  41. error in Y ie Y +/- ErrY, and Fi = the i'th theoretical Y value
  42. obtained from the model being used, ie Fi = F(Xi,U,P1,P2,...P8).
  43.  
  44. It is EXTREMELY important that you provide a reasonable good
  45. guess for the starting values of the model parameters {Pi}.
  46. In other words, you should NOT merely treat this application
  47. as a "BLACK BOX" type program. It is better if you have a fair
  48. understanding of the process or phenomenon that is being modeled.
  49. This means that you should then have a good idea of the range of
  50. possible values of at least some of the model parameters.
  51.  
  52. Also if your Y data has fairly large errors then you should
  53. not be tempted to use an over elaborate model where a linear
  54. curve fit would do! Note that increasing the number of parameters
  55. (eg going from a 2 parameter model to a 4 parameter model) may
  56. provide an apparent improvement in the goodness of fit for your
  57. data, but you should beware as there is always a risk of 'over
  58. parameterising'! What I am really saying is that you should
  59. always use the simplest possible model unless you have very
  60. good reasons for going to a more complex model. 
  61.  
  62.    I have used this application (together with the !SciGraph
  63. application) to produce both PhD thesis and publication quality
  64. figures for a variety of projects.
  65.  
  66.  
  67.    COPYRIGHT NOTICE  
  68.    ================
  69.  
  70.    The !SciGraph and !SciModel applications together with the SciGraph
  71. data file format are © Dr. Roderick Ferguson.  Furthermore, you use this
  72. software at your own risk! The author accepts no responsibility whatsoever
  73. for any damage caused by these applications whether to Hardware or other software
  74. or to other people.
  75. However, not withstanding the above, I should tell you that these applications
  76. have been tested for at least a year now and they should be 99.9% bug free.
  77. If you DO find any bugs ie "unsupported extra features" then please let me know!!
  78.  
  79.  
  80. I can be contacted by :-
  81.  
  82.     Letter       Polymer Laboratory,
  83.     ------       Chemistry Department,
  84.                  Heriot-Watt University,
  85.                  Riccarton Campus,
  86.                  Edinburgh, Scotland.
  87.                         
  88.     Phone        031-449-5111 (extension 4109 or 4239).
  89.     -----
  90.  
  91.     Email        CHERRF@UK.AC.HERIOT-WATT.VAXA
  92.     -----
  93.  
  94.  
  95. ===============================================================
  96.     For the sake of completeness, I will now briefly describe
  97. the format of a SciGraph data file (File type = &2FF) :-
  98.  
  99.    The format used is CSV (comma seperated value).
  100.  
  101. 1) The first line in the file can be a comment line, which must
  102.    start with a '*' character.
  103.  
  104. 2) The Data section starts with the keyword 'DATA'. This is
  105.    followed by the number of data points and the standard error
  106.    assosciated with each data point. This can be overrided 
  107.    however by including a seperate standard error (ErrY) for
  108.    each data point after its X,Y values.
  109.    The X,Y and ErrY data follow (one line per data point).
  110.  
  111. 3) The Model description section starts with the 'MODEL'
  112.    keyword. This is followed by the model description, then two
  113.    lines which are the model function and an optional auxiliary
  114.    function. This latter function can greatly simplify the form
  115.    of the algebraic expressions used for the partial derivatives
  116.    later on. The number of parameters is next, then lines
  117.    containing each parameter and a flag indicating if this
  118.    parameter is to be frozen during the curve fit or allowed to
  119.    vary. Finally, one has the expressions for the partial
  120.    derivatives of the main function with respect to each
  121.    adjustable parameter Pi.
  122.  
  123. 4) The !SciGraph 'LEGEND' keyword. After this keyword, one can
  124.    have lines for the Graph Title, the X axis legend and the Y
  125.    axis legend. Finally, one has the two scientific notation
  126.    flags (again, one per line) 0 = don't use scientific notation
  127.    for the axis numbers, and -1 = use scientific notation for
  128.    the axis numbers.
  129.  
  130. Inspection of the 'demo' SciGraph data files in the 'SciGraph'
  131. directory supplied with this application illustrates the
  132. format used.
  133.  
  134.    Also, note that lines corresponding to section (f) can be
  135. ommitted, and a model description chosen from the !SciModel
  136. main menu and the data file saved (after performing a curve
  137. fit). Further models could be added to the 'Models' file.
  138. The maximum allowed number of 'built in' models is 20.
  139. ===============================================================
  140.